<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
    <style>
        .yz1,.yz2,.yz3,.yz4,.yz5,.yz6{text-align: left !important; margin-left: 20px;}
        .yz1 :before,.yz2 :before,.yz3 :before,.yz4 :before,.yz5 :before,.yz6 :before{ font-family: iconfont;
            font-style: inherit;
            padding: 0 5px;
            font-size: 14px;content: "\E60D";}
    </style>
</head>
<body>
<div id="app" class="setQuestion">
    <include file="./public/header.html"/>

    <div data-v-4ba25880="" class="container notSign fix pt15" s="[object Object]">
        <div data-v-4ba25880="" class="userMain mgb10 setQuestion">
            <ul data-v-4ba25880="" class="queue">
                <li data-v-4ba25880="" class="now"><span data-v-4ba25880="">设置新密保问题</span><i data-v-4ba25880=""></i>
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">完成</span><i data-v-4ba25880=""></i></li>
            </ul>
            <input type="hidden" name="id" id="uid" value="{$id}">
            <ul data-v-4ba25880="" class="submitContent mglr30 mgt15">
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题一：</span>
                      <select  id="anser1" class="diyselect sb" style="width: 231px; height: 30px;">
                          <option value="">请选择密保问题</option>
                           <foreach name="arr" item="v">
                               <option value="{$v.id}">{$v.content}</option>
                           </foreach>
                       </select> <span class="yz1" style="width: 300px"></span>
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案一：</span>
                    <input data-v-4ba25880="" name="anser1" id="yi" tag="答案一" placeholder="请输入答案" type="text" class="userInput"> <span class="yz2" style="width: 300px"></span><!---->
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题二：</span>
                    <select id="anser2" class="diyselect sb" style="width: 231px; height: 30px;">
                        <option value="">请选择密保问题</option>
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select><span class="yz3" style="width: 300px"></span>
                  </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案二：</span>
                    <input data-v-4ba25880="" tag="答案二" name="anser2" id="er" placeholder="请输入答案" type="text" class="userInput"><span class="yz4" style="width: 300px"></span> <!---->
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题三：</span>
                    <select id="anser3" class="diyselect sb" style="width: 231px; height: 30px;">
                        <option value="">请选择密保问题</option>
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select><span class="yz5" style="width: 300px"></span>
                 </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案三：</span>
                    <input data-v-4ba25880="" tag="答案三" name="anser3" id="san" placeholder="请输入答案" type="text" class="userInput"> <span class="yz6" style="width: 300px"></span><!---->
                </li>

                <li data-v-4ba25880=""><span data-v-4ba25880=""></span> 、
                    <a data-v-4ba25880="" class="submitBtn ClickShade" onclick="sav()">确定</a>
                </li>
            </ul>
        </div>
    </div>

    <include file="./public/footer.html"/>
</div>
<div id="layermbox232" class="layermbox layermbox0 layermshow" index="232">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·密保问题设置成功·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<div id="wenti" class="layermbox layermbox0 layermshow" index="232">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·选择的问题不能重复·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
    $(function () {
        personalInfo();
    })

    function sav(){
        var id = $("#uid").val();

        var question1 = $("#anser1").val();
        var question2 = $("#anser2").val();
        var question3 = $("#anser3").val();
        var anser1= $("#yi").val();
        var anser2= $("#er").val();
        var anser3= $("#san").val();
        if(question1 == ''){
            $(".yz1").html("<font color='red'>请选择密保问题一</font>");
            return false;
        }else {
            $(".yz1").html("");
        }
        if(anser1 == ''){
            $(".yz2").html("<font color='red'>答案一不能为空</font>");
            return false;
        }else {
            $(".yz2").html("");
        }
        if(question2 == ''){
            $(".yz3").html("<font color='red'>请选择密保问题二</font>");
            return false;
        }else {
            $(".yz3").html("");
        }

        if(anser2 == ''){
            $(".yz4").html("<font color='red'>答案二不能为空</font>");
            return false;
        }else {
            $(".yz4").html("");
        }
        if(question3 == ''){
            $(".yz5").html("<font color='red'>请选择密保问题三</font>");
            return false;
        }else {
            $(".yz5").html("");
        }

        if(anser3 == ''){
            $(".yz6").html("<font color='red'>答案三不能为空</font>");
            return false;
        }else {
            $(".yz6").html("");
        }
        if(question1 == question2 || question2 == question3 || question1 == question3){
            $("#wenti").show();
            return false;
        }
        $(".layermbtn").click(function(){
            $(this).parents("#wenti").hide();
        });

        $.ajax({
            type: "POST",
            url: "{:U('Users/setQuestion')}",
            data: {'id':id,'question1':question1,'question2':question2,'question3':question3,'anser1':anser1,'anser2':anser2,'anser3':anser3},
            success: function(dat){
                if(dat==1){
                    $("#layermbox232").show();
                }
            }
        });
    }
    $("#layermbox232").click(function(){
        window.location.href="{:U('Users/securityCenter')}";
    })

</script>
</body>
</html>